package main

import "fmt"

func printResult(pf func(...string), list ...string) {
	pf(list...)
}

func line(list ...string) {
	fmt.Print("|")
	for _, e := range list {
		fmt.Print(e)
		fmt.Print("\t|")
	}
	fmt.Println()
}

func column(list ...string) {
	for _, e := range list {
		fmt.Println(e)
	}
	fmt.Println()
}

func main() {
	names := []string{"kk", "bb", "cc"}
	printResult(line, names...)
	printResult(column, names...)

	hi := func(name string) {
		fmt.Printf("Hi,%s\n", name)
	}

	hi("aa")
	hi("bb")

	func() {
		fmt.Println("i am no name function")
	}()

	printResult(func(list ...string) {
		for i, v := range list {
			fmt.Printf("%d: %s\n", i, v)
		}
	}, names...)

}
